package com.weipai.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import tk.mybatis.spring.annotation.MapperScan;

@SpringBootApplication
//扫描mybatis的dao接口
@MapperScan(basePackages = {"com.weipai.demo.mapper"})
//扫描注解目录
@ComponentScan("com.weipai")
/*@ImportResource(locations = {"classpath:spring/*.xml"})*/
@EnableTransactionManagement
@ComponentScan(basePackages={"com.weipai.demo.util.CorsConf"})
public class DemoApplication extends SpringBootServletInitializer {

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(DemoApplication.class);
    }

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }

}
